﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Ribbon_Group : UserControl
{
    public enum GrpAlign { Left, Center, Right };

    private System.Collections.Generic.List<Control> _Items;

    [PersistenceMode(PersistenceMode.InnerProperty)]
    public System.Collections.Generic.List<Control> ContentTemplate
    {
        get { return _Items; }
        set { _Items = value; }
    }

    /// <summary>
    /// Sets the items alignment in the group
    /// </summary>
    public GrpAlign GroupAlign
    {
        set { this.ct_cell.Style.Add("text-align",value.ToString()); }
    }

    /// <summary>
    /// Text to show in the lower part of the group
    /// </summary>
    public string Text
    {
        get { return this.Literal1.Text; }
        set { this.Literal1.Text = value; this.tt_cell.Attributes["title"] = value; }
    }

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        if (_Items != null)
        {
            foreach (Control obj in _Items)
            {
                this.PlaceHolder1.Controls.Add(obj);
            }
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
